﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace planet_express
{
    public partial class Site1 : System.Web.UI.MasterPage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            //Comprobar si existe sesion

            if (Session["login"] != null)
            {
                usuario.ActiveViewIndex = 1;
                nom_User.Text = Session["login"].ToString(); 
            }
            else
                usuario.ActiveViewIndex = 0;

            //Contadores
            int currentNumberOfUsers = planet_express.Global.CurrentNumberOfUsers;
            int totalNumberOfUsers = planet_express.Global.TotalNumberOfUsers;
            lblCurrentNumberOfUsers.Text = "Usuarios conectados: " +currentNumberOfUsers.ToString();
            lblTotalNumberOfUsers.Text ="Usuarios totales: "  +totalNumberOfUsers.ToString();
        }

        protected void Logout_Clicl(object sender, ImageClickEventArgs e)
        {
            Session.RemoveAll();
            Response.Redirect("Default.aspx"); //redirecciono a la pagina principal por ahora
           // Session["username"].Abandon = true;
        }

        protected void twitter_Click(object sender, ImageClickEventArgs e)
        {
            System.Diagnostics.Process.Start("https://twitter.com/PlanetExpress3");
        }
    }
}